<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .container {
            justify-content: center;
            align-items: center;
            width: 100vw;
        }
        .container img{

            width: 100%;
        }
        .btn button {
            background-color: #ff3f19;
            width: 60vw;
            height: 5vh;
            position: fixed;
            left: 20vw;
            bottom: 0;
            border-radius: 10px;
            color: #ffffff;
        }

        #qrcode {
            width: 100px;
            height: 100px;
            position: fixed;
            bottom: 50%;
            left: 50%;
            border-radius: 10px;
            color: #ffffff;
        }
    </style>
</head>
<body>
<div id="qrcode"></div>
    <div class="container">
        <img src="./img/1.png" alt="">
        <img src="./img/2.png" alt="">
        <img src="./img/3.png" alt="">
        <img src="./img/4.png" alt="">
        <img src="./img/5.png" alt="">
        <img src="./img/6.png" alt="">
    </div>
    <div class="btn">

        <button>立即支付19.9元 自助进群</button>
    </div>

    <script src="./js/axios.min.js"></script>
    <script src="./js/qrcode.js"></script>
    <script type="text/javascript">
        if(document.cookie){
            location.href='success.html';
        }
        var btn = document.querySelector(".btn button");

        btn.onclick = function(){
            axios.get("http://yao1guigu.w1.luyouxia.net/api/pay/?money=0.01").then(function (res) {
                console.log(res);
                if(res.data.qrcode){
                    var qrcode = new QRCode("qrcode");
                    qrcode.makeCode(res.data.qrcode);
                }

                if(res.data.payurl){
                    location.href = res.data.payurl;
                }
            }).catch(function (err) {}).finally(function () {})
        }
    </script>
</body>
</html>